#include<bits/stdc++.h>
using namespace std;
int main()
{
	char a[300],b[300];
	gets(a);
	gets(b);
	long long j,i,s1=1,s2=1;
	for(i=0;i<strlen(a);i++)
	s1=s1*(a[i]-64);
	for(i=0;i<strlen(b);i++)
	s2=s2*(b[i]-64);
	if(s1%47==s2%47)
	cout<<"I got it!";
	else
	cout<<"It is a dream.";
    return 0;
}
